import { http } from "./request";

export default {
  // AI问题知识 分页查询
  AiDocPagedList(data: any) {
    return http.request({
      url: "/api/AiDoc/PagedList",
      method: "post",
      data: data,
    });
  },
  AiDocListInVolcEngineKnowledgebase(data: any) {
    return http.request({
      url: "/api/Ai/DocListInVolcEngineKnowledgebase", // 移除硬编码的/test
      method: "post",
      data: {
        collection_name: "test", // 添加collection_name参数
        ...data, // 保留其他参数
      },
    });
  },

  // AI问题知识 选项列表
  AiDocOptions(data: any) {
    return http.request({
      url: "/api/AiDoc/Options",
      method: "post",
      data: data,
    });
  },

  // AI问题知识 导出Excel
  AiDocExport(data: any) {
    return http.request({
      url: "/api/AiDoc/Export",
      method: "post",
      data: data,
    });
  },

  // AI问题知识 判断主键是否存在
  AiDocExists(data: any) {
    return http.request({
      url: "/api/AiDoc/Exists",
      method: "post",
      data: data,
    });
  },

  // AI问题知识 创建
  AiDocCreate(data: any) {
    return http.request({
      url: "/api/AiDoc/Create",
      method: "post",
      data: data,
    });
  },

  // AI问题知识 获取单个数据
  AiDocFetch(data: any) {
    return http.request({
      url: "/api/AiDoc/Fetch",
      method: "post",
      data: data,
    });
  },

  // AI问题知识 详情,可用于编辑/查看使用
  AiDocFetchModel(data: any) {
    return http.request({
      url: "/api/AiDoc/FetchModel",
      method: "post",
      data: data,
    });
  },

  // AI问题知识 删除
  AiDocDelete(data: any) {
    return http.request({
      url: "/api/AiDoc/Delete",
      method: "post",
      data: data,
    });
  },
  AiDocDelete2(data: any) {
    return http.request({
      url: "/api/Ai/VolcEngineDocDelete",
      method: "post",
      data: data,
    });
  },

  // AI问题知识 更新
  AiDocUpdate(data: any) {
    return http.request({
      url: "/api/AiDoc/Update",
      method: "post",
      data: data,
    });
  },
  UploadAiDocToVolcEngineKnowledgebase(data: any) {
    return http.request({
      url: "/api/Ai/UploadAiDocToVolcEngineKnowledgebase",
      method: "post",
      data: data,
    });
  },
};
